<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/25
 * Time: 8:18
 */

class  myException extends Exception{
    public  function getAllInfo(){
        return "异常发生的信息为:{$this->getMessage()}";
    }

}




try{
    $x=new myException("有人给你发错误了");
    throw  $x;
}
catch (Exception $e){
    echo $e->getAllInfo();
}
?>